Ecuador Land Finder

Visualization of the area of interest

library(sf)
library(tmap)
library(mapview)

source("jobbers/custom_bounding_box.R")

Introduction

Let us first show the area of interest. We show it at the four available levels: country, province, canton, and parish. The data is from the GADM project, which provides high-resolution maps of administrative areas worldwide.

# read the files
gadm41_ECU_country <- readRDS("clean_data/gadm41_ECU_country_custom.rds")
gadm41_ECU_provinces <- readRDS("clean_data/gadm41_ECU_province_custom.rds")
gadm41_ECU_cantons <- readRDS("clean_data/gadm41_ECU_canton_custom.rds")
gadm41_ECU_parishes <- readRDS("clean_data/gadm41_ECU_parish_custom.rds")
# set mapview options
mapviewOptions(basemaps = c("OpenStreetMap",
                            "Esri.WorldImagery",
                            "OpenTopoMap"))

Visualization of the area of interest

We choose the following polygon to delimit the area of interest. The polygon is defined by the coordinates of the four corners: Northeast, Southeast, Southwest, and Northwest.

coords <- rbind(NE, SE, SW, NW, NE) # from source("jobbers/custom_bounding_box.R")
crop_polygon <- st_polygon(list(coords)) %>% 
  st_sfc(crs = st_crs(gadm41_ECU_country)) # match CRS of your data
crop_polygon_sf <- st_sf(geom = crop_polygon)
mapview::mapview(crop_polygon_sf,
                 alpha.regions = 0.4,    # fill transparency
                 color = "black",        # border color
                 alpha = 1,            # border transparency
                 legend = FALSE)
Figure 1: This shows the polygon that delimits the area of interest. Click on the region to see more details.

At the country level

mapview(
  gadm41_ECU_country,
  zcol = "COUNTRY",        # attribute used for fill
  alpha.regions = 0.4,    # fill transparency
  color = "black",        # border color
  alpha = 1,            # border transparency
  legend = FALSE           # remove legend
)
Figure 2: This shows the region of interest at the country level. Click on the region to see more details.

At the province level

mapview(
  gadm41_ECU_provinces,
  zcol = "NAME_1",        # attribute used for fill
  alpha.regions = 0.4,    # fill transparency
  color = "black",        # border color
  alpha = 1,            # border transparency
  legend = FALSE           # remove legend
)
Figure 3: This shows the region of interest at the province level. Click on the region to see more details.

At the canton level

mapview(
  gadm41_ECU_cantons,
  zcol = "NAME_2",        # attribute used for fill
  alpha.regions = 0.4,    # fill transparency
  color = "black",        # border color
  alpha = 1,            # border transparency
  legend = FALSE           # remove legend
)
Figure 4: This shows the region of interest at the canton level. Click on the region to see more details.

At the parish level

mapview(
  gadm41_ECU_parishes,
  zcol = "NAME_3",        # attribute used for fill
  alpha.regions = 0.4,    # fill transparency
  color = "black",        # border color
  alpha = 1,            # border transparency
  legend = FALSE           # remove legend
)
Figure 5: This shows the region of interest at the parish level. Click on the region to see more details.

References

grateful::cite_packages(output = "paragraph", out.dir = ".")

We used R version 4.3.2 (R Core Team 2023) and the following R packages: mapview v. 2.11.2 (Appelhans et al. 2023), osmextract v. 0.5.3 (Gilardi and Lovelace 2025), plotly v. 4.11.0 (Sievert 2020), renv v. 1.0.7 (Ushey and Wickham 2024), rmarkdown v. 2.28 (Xie, Allaire, and Grolemund 2018; Xie, Dervieux, and Riederer 2020; Allaire et al. 2024), sf v. 1.0.21 (Pebesma 2018; Pebesma and Bivand 2023), tidyverse v. 2.0.0 (Wickham et al. 2019), tmap v. 4.1 (Tennekes 2018).

References

Allaire, JJ, Yihui Xie, Christophe Dervieux, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, et al. 2024. rmarkdown: Dynamic Documents for r. https://github.com/rstudio/rmarkdown.
Appelhans, Tim, Florian Detsch, Christoph Reudenbach, and Stefan Woellauer. 2023. mapview: Interactive Viewing of Spatial Data in r. https://github.com/r-spatial/mapview.
Gilardi, Andrea, and Robin Lovelace. 2025. osmextract: Download and Import Open Street Map Data Extracts. https://docs.ropensci.org/osmextract/.
Pebesma, Edzer. 2018. Simple Features for R: Standardized Support for Spatial Vector Data.” The R Journal 10 (1): 439–46. https://doi.org/10.32614/RJ-2018-009.
Pebesma, Edzer, and Roger Bivand. 2023. Spatial Data Science: With applications in R. Chapman and Hall/CRC. https://doi.org/10.1201/9780429459016.
R Core Team. 2023. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Sievert, Carson. 2020. Interactive Web-Based Data Visualization with r, Plotly, and Shiny. Chapman; Hall/CRC. https://plotly-r.com.
Tennekes, Martijn. 2018. tmap: Thematic Maps in R.” Journal of Statistical Software 84 (6): 1–39. https://doi.org/10.18637/jss.v084.i06.
Ushey, Kevin, and Hadley Wickham. 2024. renv: Project Environments. https://CRAN.R-project.org/package=renv.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown.
Xie, Yihui, Christophe Dervieux, and Emily Riederer. 2020. R Markdown Cookbook. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown-cookbook.